<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdvertsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('adverts', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('position_id')->comment('[v1.0]广告位ID');
            $table->string('image')->comment('[v1.0]广告图片');
            $table->string('title')->nullable()->comment('[v1.0]广告标题');
            $table->string('desc')->nullable()->comment('[v1.0]广告描述');
            $table->string('link')->nullable()->comment('[v1.0]广告链接');
            $table->tinyInteger('order')->default(0)->comment('[v1.0]排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('adverts');
    }
}
